package com.zhehekeji.opsys.api.aop;

import org.apache.commons.lang.StringUtils;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @ClassName ConfigGetAdvice
 * @Description TODO
 * @author chenweiliu chenwei.liu@163.com
 * @date 2015-5-14   上午10:52:23
 */
@Aspect
public class ConfigGetAdvice {
private static final Logger logger = LoggerFactory.getLogger(ConfigGetAdvice.class);
	
	@AfterReturning(value="PointcutsDefinition.checkPointcutDef()", returning="configValue")
	public void doCheck(String configValue){
		if (StringUtils.isEmpty(configValue)){
			logger.error("配置文件config.properties，【" + configValue+"】配置错误，不能为空。");
			throw new RuntimeException("配置文件config.properties，【" + configValue+"】配置错误，不能为空。");
		}
	}
}
